import request from '@/utils/request'

// 查询不良品转入主列表
export function listMstr(query) {
  return request({
    url: '/repertory/rejectsInto/list',
    method: 'get',
    params: query
  })
}

// 查询不良品转入主详细
export function getMstr(blzmId) {
  return request({
    url: '/repertory/rejectsInto/' + blzmId,
    method: 'get'
  })
}

// 新增不良品转入主
export function addMstr(data) {
  return request({
    url: '/repertory/rejectsInto',
    method: 'post',
    data: data
  })
}

// 修改不良品转入主
export function updateMstr(data) {
  return request({
    url: '/repertory/rejectsInto',
    method: 'put',
    data: data
  })
}

// 删除不良品转入主
export function delMstr(blzmId) {
  return request({
    url: '/repertory/rejectsInto/' + blzmId,
    method: 'delete'
  })
}

// 导出不良品转入主
export function exportMstr(query) {
  return request({
    url: '/repertory/rejectsInto/export',
    method: 'get',
    params: query
  })
}

// 获取需要添加的数据
export function getNeedData(query) {
  return request({
    url: '/repertory/rejectsInto/getNeedData',
    method: 'get',
    params: query
  })
}

export function addNeedData(data) {
  return request({
    url: '/repertory/rejectsInto/addNeedData',
    method: 'post',
    data: data
  })
}

export function listBlzd(blzdDjbh) {
  return request({
    url: '/repertory/rejectsInto/listBlzd/' + blzdDjbh,
    method: 'get'
  })
}
export function submitBlzm(blzmDjbh) {
  return request({
    url: '/repertory/rejectsInto/submitBlzm/' + blzmDjbh,
    method: 'put'
  })
}
export function checkBlzm(blzmDjbh) {
  return request({
    url: '/repertory/rejectsInto/checkBlzm/' + blzmDjbh,
    method: 'put'
  })
}

export function postBlzm(blzmDjbh) {
  return request({
    url: '/repertory/rejectsInto/postBlzm/' + blzmDjbh,
    method: 'put'
  })
}

// 删除子项明细数据
export function delBlzd(blzdId) {
  return request({
    url: '/repertory/rejectsInto/delBlzd/' + blzdId,
    method: 'delete'
  })
}


export function backBlzm(blzmDjbh, backReson) {
  return request({
    url: '/repertory/rejectsInto/backBlzm/' + blzmDjbh + '/' + backReson,
    method: 'put'
  })
}
